package com.ophiux.cs.domain.consult.model.valueobj;

import com.ophiux.cs.domain.core.ValueObject;

/**
 * 咨询用户登录验证结果
 * @author chenh
 *
 */
public class CSUserLoginResult extends ValueObject{

	private boolean validResult;	//true：成功 ；	false:失败
	
	private String error_code;	//错误码
	
	private String error_message;	//结果描述
	
	private String login_token;	//本次登录唯一标识
	
	private String target_id;	//用户唯一标志

	public CSUserLoginResult(boolean validResult, String error_code, String error_message) {
		super();
		this.validResult = validResult;
		this.error_code = error_code;
		this.error_message = error_message;
	}

	public boolean isValidResult() {
		return validResult;
	}

	public void setValidResult(boolean validResult) {
		this.validResult = validResult;
	}

	public String getError_code() {
		return error_code;
	}

	public void setError_code(String error_code) {
		this.error_code = error_code;
	}

	public String getError_message() {
		return error_message;
	}

	public void setError_message(String error_message) {
		this.error_message = error_message;
	}
	
	public static CSUserLoginResult success(){
		CSUserLoginResult result = new CSUserLoginResult(true, "100", "登录验证成功");
		return result;
	}
	
	public static CSUserLoginResult fail(String error_code , String error_message){
		CSUserLoginResult result = new CSUserLoginResult(false, error_code, error_message);
		return result;
	}
	
	public boolean loginSuccess() {
		return validResult;
	}

	public String getLogin_token() {
		return login_token;
	}

	public void setLogin_token(String login_token) {
		this.login_token = login_token;
	}

	public String getTarget_id() {
		return target_id;
	}

	public void setTarget_id(String target_id) {
		this.target_id = target_id;
	}
	
}
